Merged
Conversation
…ntain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ptimize clang-tidy run
There was a problem hiding this comment.
Cpp-linter Review
Used clang-tidy v20.1.2
Click here for the full clang-tidy patch
diff --git a/src/video_frame.cpp b/src/video_frame.cpp
index 870dfee..63a30b3 100644
--- a/src/video_frame.cpp
+++ b/src/video_frame.cpp
@@ -298 +298 @@ VideoFrame VideoFrame::create(int width, int height, VideoBufferType type) {
- return VideoFrame(width, height, type, std::move(buffer));
+ return {width, height, type, std::move(buffer)};
@@ -306 +306 @@ std::vector<VideoPlaneInfo> VideoFrame::planeInfos() const {
- uintptr_t base = reinterpret_cast<uintptr_t>(data_.data());
+ auto base = reinterpret_cast<uintptr_t>(data_.data());
@@ -318 +318 @@ VideoFrame VideoFrame::convert(VideoBufferType dst, bool flip_y) const {
- return VideoFrame(width_, height_, type_, std::move(buf));
+ return {width_, height_, type_, std::move(buf)};
@@ -376 +376 @@ VideoFrame VideoFrame::fromOwnedInfo(const proto::OwnedVideoBuffer &owned) {
- return VideoFrame(width, height, type, std::move(buffer));
+ return {width, height, type, std::move(buffer)};
diff --git a/src/trace/event_tracer.cpp b/src/trace/event_tracer.cpp
index 8809993..3340f00 100644
--- a/src/trace/event_tracer.cpp
+++ b/src/trace/event_tracer.cpp
@@ -40,2 +40,2 @@
-namespace livekit {
-namespace trace {
+
+namespace livekit::trace {
@@ -179,3 +179,3 @@ std::string FormatEventJson(const TraceEventData &event, uint64_t start_time) {
- oss << "\"ph\":\"" << event.phase << "\",";
- oss << "\"cat\":\"" << JsonEscape(event.category) << "\",";
- oss << "\"name\":\"" << JsonEscape(event.name) << "\",";
+ oss << R"("ph":")" << event.phase << "\",";
+ oss << R"("cat":")" << JsonEscape(event.category) << "\",";
+ oss << R"("name":")" << JsonEscape(event.name) << "\",";
@@ -187 +187 @@ std::string FormatEventJson(const TraceEventData &event, uint64_t start_time) {
- oss << ",\"id\":\"0x" << std::hex << event.id << std::dec << "\"";
+ oss << R"(,"id":"0x)" << std::hex << event.id << std::dec << "\"";
@@ -430 +430 @@ void StopTracing() {
- g_trace_file << "],\"displayTimeUnit\":\"ms\"}";
+ g_trace_file << R"(],"displayTimeUnit":"ms"})";
@@ -444,2 +444,2 @@ bool IsTracingEnabled() {
-} // namespace trace
-} // namespace livekit
+} // namespace livekit::trace
+
Have any feedback or feature suggestions? Share it here.
There was a problem hiding this comment.
Cpp-linter Review
Used clang-tidy v20.1.2
Click here for the full clang-tidy patch
diff --git a/src/trace/event_tracer.cpp b/src/trace/event_tracer.cpp
index 8809993..3340f00 100644
--- a/src/trace/event_tracer.cpp
+++ b/src/trace/event_tracer.cpp
@@ -40,2 +40,2 @@
-namespace livekit {
-namespace trace {
+
+namespace livekit::trace {
@@ -179,3 +179,3 @@ std::string FormatEventJson(const TraceEventData &event, uint64_t start_time) {
- oss << "\"ph\":\"" << event.phase << "\",";
- oss << "\"cat\":\"" << JsonEscape(event.category) << "\",";
- oss << "\"name\":\"" << JsonEscape(event.name) << "\",";
+ oss << R"("ph":")" << event.phase << "\",";
+ oss << R"("cat":")" << JsonEscape(event.category) << "\",";
+ oss << R"("name":")" << JsonEscape(event.name) << "\",";
@@ -187 +187 @@ std::string FormatEventJson(const TraceEventData &event, uint64_t start_time) {
- oss << ",\"id\":\"0x" << std::hex << event.id << std::dec << "\"";
+ oss << R"(,"id":"0x)" << std::hex << event.id << std::dec << "\"";
@@ -430 +430 @@ void StopTracing() {
- g_trace_file << "],\"displayTimeUnit\":\"ms\"}";
+ g_trace_file << R"(],"displayTimeUnit":"ms"})";
@@ -444,2 +444,2 @@ bool IsTracingEnabled() {
-} // namespace trace
-} // namespace livekit
+} // namespace livekit::trace
+
Have any feedback or feature suggestions? Share it here.
Contributor
stephen-derosa
left a comment
There was a problem hiding this comment.
in general this looks good, thanks for doing! I have some questions/comments, nothing major
xianshijing-lk
approved these changes
Apr 21, 2026
Collaborator
xianshijing-lk
left a comment
There was a problem hiding this comment.
One comment about the job.
xianshijing-lk
approved these changes
Apr 21, 2026
Collaborator
xianshijing-lk
left a comment
There was a problem hiding this comment.
lgtm assuming you will address the comments.
stephen-derosa
approved these changes
Apr 21, 2026
Contributor
stephen-derosa
left a comment
There was a problem hiding this comment.
in general this looks good, thanks for doing!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for
clang-tidystatic analysis within the CI. The list of initial checks can be found in the.clang-tidyfile at the root of the repository.Fixes to
.h/.cppfiles flagged by the analysis were also done.